<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <a href="#" onmouseover="alert('鼠标已经移动到这里了')" class="a1">
        我是a标签
    </a>
    <script type="text/javascript">
        function myevent(){
            alert('你的鼠标已经离开')
        }
        document.getElementsByClassName("a1")[0].onmouseout = myevent;
    </script>

</body>
</html>